﻿using Common.Model;
using Gzh.BLL.Infrastructure;
using Gzh.Core;
using Gzh.Core.Constant;
using Gzh.Core.Model;
using Gzh.DAL.Models;
using Gzh.DAL.Transaction;
using Gzh.Lib;
using Gzh.Lib.BaiduMap;
using Gzh.Lib.Redis;
using Gzh.UI.API.Filter;
using Gzh.UI.API.Helpers;
using Gzh.UI.API.hubs;
using JPush;
using log4net.Config;
using Microsoft.AspNet.SignalR;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Senparc.Weixin.Entities.TemplateMessage;
using Senparc.Weixin.WxOpen;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;

namespace Gzh.UI.API.Controllers
{
    /// <summary>
    /// ${table.comment}回调函数
    /// </summary>
    [NoApiAuth(IsForceEnable = true)]
    public class CallbackController : BaseApiController
    {
        #region  ${table.comment}
        [HttpGet]
        public async Task<OperationResult> ${ClassName}Callback(string data)
        {
            //1 日志记录
            LogHelper.Info("${ClassName}Callback", "${ClassName}Callback data=" + data);
            WanfengModel<Object> wm = null;
            try
            {
                wm = JsonConvert.DeserializeObject<WanfengModel<Object>>(data);
                if (wm == null)
                {
                    return new OperationResult("无有用数据传入");
                }
            }
            catch (Exception)
            {
                LogHelper.Info("WanfengksqCallback", "格式错误");
                return new OperationResult("格式错误");
            }
            int deviceCode = 0;

            return new OperationResult(OperationResultType.Success);

        }

        #endregion

    }
}